import React, { useContext } from 'react'
import { MyContext } from '../../utils/index'
const data = 'G改变P的数据'
export default function GrapSon() {
    const { params, event } = useContext(MyContext)
    const changeP = () => {
        event(data)
    }
    return (
        <>
            <p>跨组件传递的数据:{params}</p>
            <button onClick={changeP}>G改变P的数据</button>
        </>
    )
}